var uploadifyBindFun = function (foodId){
    jQuery("#file_upload").uploadify({
		'uploader' : '/scripts/juploadify/uploadify.swf?r='+new Date().getTime(),
		'script' : '/admin/food/upload/upload.do?foodId='+foodId,
		'cancelImg' : '/scripts/juploadify/cancel.png',
		'queueID' : 'fileQueue',
		'auto' : false,
		'multi' : false,
		'simUploadLimit' : 10,
		'sizeLimit' : 512000,//500k
		'queueSizeLimit' : 10,
		'fileDesc' : '支持格式：jpg,png,jpeg',
		'fileExt' : '*.jpg;*.png;*.jpeg',
		'height' : 27,
		'width' : 80,
		'fileDataName' : 'Filedata',
		'buttonImg' : '/images/liulan.jpg',
		'wmode' : 'transparent',
		'onCancel' : function(event, queueID, fileObj, data) {
			jQuery('#temp_file').val('');
		},
		'onProgress' : function(event, queueID, fileObj, data) {
		},
		'onComplete' : function(event, queueID, fileObj, response, data) {
			if(response){
				var json = JSON.parse(response);
				if(json.code=='0'){
					$.ligerDialog.success(json.msg);
				}else if(json.code){
					$.ligerDialog.error(json.msg);
				}
			}else{
				$.ligerDialog.error("网络发生异常,请稍后再试!");
			}
			jQuery('#temp_file').val('');
		},
		'onError' : function(event, queueID, fileObj, errorObj) {
			$.ligerDialog.error("网络发生异常,请稍后再试!");
			jQuery('#temp_file').val('');
		},
		'onSelect' : function(event, queueID, fileObj) {
			jQuery('#temp_file').val(fileObj.name);
		},
		'onAllComplete' : function(event, data) {
		}
		
	});
    jQuery("#start_upload").click(function(){
    	jQuery('#file_upload').uploadifySettings("script", '/admin/food/upload/upload.do?foodId='+foodId+"&uuid="+getCookie("uuid"));
    	jQuery("#file_upload").uploadifyUpload();
    });
};
//JSON.stringify
